import socket
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket.connect(('localhost', 12345))

message = input("请输入要发送的消息: ")
client_socket.send(message.encode('utf-8'))

received_message = client_socket.recv(1024).decode('utf-8')
print(received_message)

client_socket.close()